package com.aiwei.tdjk.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * Created with IntelliJ IDEA
 * Created By zhongxuexi
 * Date: 2017/8/30
 * Time: 9:10
 */
@NoArgsConstructor
@AllArgsConstructor
public enum MonthsOfYearEnum {
    oneMonth(1, "1个月"), twoMonth(2, "2个月"), threeMonth(3, "3个月"), fourMonth(4, "4个月"), fiveMonth(5, "5个月"), sixMonth(6, "6个月"),
    sevenMonth(7, "7个月"), eightMonth(8, "8个月"), nineMonth(9, "9个月"), tenMonth(10, "10个月"), elevenMonth(11, "11个月"),
    twelveMonth(12, "12个月");

    @Getter
    private Integer code;
    @Getter
    private String info;


    public static MonthsOfYearEnum getValue(Integer code) {
        final MonthsOfYearEnum[] values = MonthsOfYearEnum.values();
        for (MonthsOfYearEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
